<#include "include/_meta.html">
<!--/meta 作为公共模版分离出去-->

<title>修改字典信息 </title>
<meta name="keywords" content="汽车租赁">
<meta name="description" content="汽车租赁">
</head>
<body>
	<article class="page-container">
	<form class="form form-horizontal" id="form-sysdict-edit">
	<#if sysDict.fId != '1' &&  sysDict.fId != '0'>
		<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>父类编号：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<select id="fId" name="fId">
				<#list sysList as sysdict>
					<#if  sysdict.id == sysDict.fId>
						<option value="${sysdict.id}" selected="true">${sysdict.name}</option>
					<#else>
						<option value="${sysdict.id}">${sysdict.name}</option>
					</#if>
				</#list>
			</select>

		</div>
		</div>
	</#if>
	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>字典名称:</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" value="${sysDict.name}" id="name" name="name">
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>字典代码：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" value="${sysDict.code}" id="code" name="code">
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>字典排序：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<select id="orderNum" name="orderNum">
				<#if sysDict.orderNum == 1>
					<option value="1" selected="true">自然排序</option>
				<#else>
					<option value="1">自然排序</option>
				</#if>
				<#if sysDict.orderNum == 2>
					<option value="2" selected="true">字典编号牌排序</option>
				<#else>
					<option value="2">字典编号牌排序</option>
				</#if>
				<#if sysDict.orderNum == 3>
					<option value="3" selected="true">父类编号排序</option>
				<#else>
					<option value="3">父类编号排序</option>
				</#if>
				<#if sysDict.orderNum == 4>
					<option value="4" selected="true">字典名称排序</option>
				<#else>
					<option value="4">字典名称排序</option>
				</#if>
			</select>
		</div>
		<div class="row cl">
		<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
			
			<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
		</div>
	</div>
	</div>
	</form>
</article>
	
<!--_footer 作为公共模版分离出去--> 
<#include "include/_footer.html">
<!--/_footer /作为公共模版分离出去--> 
<script type="text/javascript">
	
	//
	$("#form-sysdict-edit").validate({
		rules:{
			name:{
				required:true
			},
			code:{
				required:true
			}
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			
	   		$.ajax({
	            type: 'post', 
				contentType:"application/json", 
	            url: '/editsysdict/${sysDict.id}',
	            data:JSON.stringify({
		                'fId': $("#fId").val(),
		                'name': $("#name").val(),
		                'code': $("#code").val(),
		                'orderNum': $("#orderNum").val()
						}),
	            success:function(data){ 
					
	 				console.log('提交成功！');
	 				alert("修改成功");
	 				var index = parent.layer.getFrameIndex(window.name);
				//	parent.$(".btn-primary").click();
					parent.layer.close(index);
					parent.location.reload();
	            }
	
	        });

			
		}
	});
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>